package com.bjpowernode.service.impl;

import com.bjpowernode.dao.UserDao;
import com.bjpowernode.dao.impl.UserDaoImpl;
import com.bjpowernode.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

//@Service("userService")//修改spring容器中bean的id
@Service
public class UserServiceImpl implements UserService {

    //依赖注入
    @Autowired
    private UserDao userDao;

    @Override
    public void addUser() {
        //调用dao层的对象来实现添加操作
        userDao.addUser();
        //System.out.println("控制事务");
    }

   /* public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }
*/

//    public UserDao getUserDao() {
//        return userDao;
//    }
//
//    public void setUserDao(UserDao userDao) {
//        this.userDao = userDao;
//    }
}
